From 082e7a06ed147d3bce1116d48b0911119b43af71 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 11 Dec 2024 00:49:43 +0000 Subject: Compile Patio code for positional structs --- ...mpiler.testing.snapshots.Snapshotter)].expected | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected (limited to 'snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected') diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected new file mode 100644 index 00000000..58661943 --- /dev/null +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -0,0 +1,83 @@ +Compilation unit elements: + +( + function-decl + "shed__runtime__gc_get_root_stack_index" + params=() + return-type=int +) +( + function-decl + "shed__runtime__gc_alloc" + params=((param "size" int) (param "runtime_type_tag" int32)) + return-type=data-ptr +) +( + function + "shed__function__User__0" + visibility=private + locals=((param "closurePointer__0" data-ptr) (param "local__name" int) (param "local__isActive" int) (val "gcRootStackIndex__0" int) (val "structValuePointer__0" data-ptr) (val "structValue__0" int)) + return-type=int + body=( + (call (local "gcRootStackIndex__0") "shed__runtime__gc_get_root_stack_index" ()) + (call (local "structValuePointer__0") "shed__runtime__gc_alloc" ((int-const (byte-size-of (struct ((struct (data-ptr int32 int32)) (struct (int int)))))) (int32-const 1))) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (int int)))) + offset=(1 0) + value=(int-const 0) + ) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (int int)))) + offset=(1 1) + value=(int-const 0) + ) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (int int)))) + offset=(0 2) + value=(int-const 1) + ) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (int int)))) + offset=(1 0) + value=(local "local__name") + ) + ( + memory-store + pointer=(local "structValuePointer__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (int int)))) + offset=(1 1) + value=(local "local__isActive") + ) + (data-ptr-to-int (local "structValue__0") (local "structValuePointer__0")) + (return (local "structValue__0")) + ) +) + +Locals: + * (val "structType__User__0" int) + * (val "closurePointer__User__0" data-ptr) + +Instructions: + +( + (call (local "closurePointer__User__0") "shed__runtime__gc_alloc" ((int-const (byte-size-of (struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ()))))))) (int32-const 2))) + ( + memory-store + pointer=(local "closurePointer__User__0") + layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ()))))) + offset=(1 0) + value=(function-ptr-const "shed__function__User__0") + ) + (data-ptr-to-int (local "structType__User__0") (local "closurePointer__User__0")) +) + +Temporary stack: + * PatioLocalRef[name=structType__User__0] -- cgit v1.2.3